package com.zero.yygh.common.util;

import org.joda.time.DateTime;
import org.joda.time.DateTimeConstants;

/**
 * @author zero
 * @desc 日期工具
 * @create 2021/3/30
 */
public class DateUtil {

  /**
   * 获取当前是周几
   *
   * @author zero
   * @date 2021/3/30 13:32
   * @param dateTime 当前时间
   * @return java.lang.String
   */
  public static String getDayOfWeek(DateTime dateTime) {
    String dayOfWeek = "";
    switch (dateTime.getDayOfWeek()) {
      case DateTimeConstants.SUNDAY:
        dayOfWeek = "周日";
        break;
      case DateTimeConstants.MONDAY:
        dayOfWeek = "周一";
        break;
      case DateTimeConstants.TUESDAY:
        dayOfWeek = "周二";
        break;
      case DateTimeConstants.WEDNESDAY:
        dayOfWeek = "周三";
        break;
      case DateTimeConstants.THURSDAY:
        dayOfWeek = "周四";
        break;
      case DateTimeConstants.FRIDAY:
        dayOfWeek = "周五";
        break;
      case DateTimeConstants.SATURDAY:
        dayOfWeek = "周六";
      default:
        break;
    }
    return dayOfWeek;
  }
}
